package com.quxing.amazon.controller;


import com.github.pagehelper.PageInfo;
import com.quxing.amazon.common.Result;
import com.quxing.amazon.model.dto.GoodQuery;
import com.quxing.amazon.model.vo.GoodVO;
import com.quxing.amazon.service.GoodService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 亚马逊商品 前端控制器
 * </p>
 *
 * @author zhb
 * @since 2021-05-09
 */
@Api(tags = "商品接口")
@RestController
@RequestMapping("/good")
@RequiredArgsConstructor
public class GoodController {

    private final GoodService goodService;

    @ApiOperation("条件查询商品")
    @GetMapping
    public Result<PageInfo<GoodVO>> pageByQuery(GoodQuery goodQuery) {
        return Result.success(goodService.pageByQuery(goodQuery));
    }

}
